from rest_framework import serializers
from ..models import DeptModel


class DeptSerializer(serializers.ModelSerializer):
    """
    部门的序列化
    """

    # 把日期类型的属性， 格式化成字符串
    create_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S", read_only=True)

    class Meta:
        model = DeptModel
        fields = "__all__"
